@extends('layout')
@section('opciones')
   <a href="{{URL::to('ventas/create')}}" class=" btn list-group-item">Vender</a> 
@stop
@section('content')
<div class="bloque row color2">
    <center><h5>REGISTRO DE VENTAS</h5></center>
</div>
{{--*/$arreglo; /*--}}         
@foreach($ventas as $venta)
    <div class="blockquote-box blockquote-info clearfix bloque">
                    <div class="square pull-left">
                        <i class="fa fa-shopping-cart fa-3x"></i>
                    </div>
                    <h4>FACTURA:</h4> <a class="btn btn-info" data-toggle="modal" data-target="#myModal" href="{{route('ventas.show',$venta->id)}}">Ver</a>
         <div class="table-responsive">
            <table class="table table-striped">
                <tr>
                    <th>#</th>
                    <th>Fecha</th>
                    <th>Cliente</th>
                    <th>N° Factura</th>
                    <th>Vendedor</th>
                    <th>SubTotal</th>
                    <th>Descuento</th>
                    <th>ITBMs</th>
                    <th>Total</th>
                </tr>
        		<tr>
        			<td>{{$arreglo[$venta->id]['id'] = $venta->id}}</td>
        			<td>{{$arreglo[$venta->id]['fecha']=$venta->fecha}}</td>
        			<td>{{$arreglo[$venta->id]['id_cliente'] = $venta->id_cliente}}</td>
        			<td>{{$arreglo[$venta->id]['num_factura']=$venta->num_factura}}</td>
        			<td>{{$arreglo[$venta->id]['contacto'] =$venta->contacto}}</td>
                    <td>{{$arreglo[$venta->id]['total_bruto']=$venta->total_bruto}}</td>
                    <td>{{($arreglo[$venta->id]['descuento'] = $venta->descuento).'% ('}}{{number_format((($venta->descuento/100)*$venta->total_bruto),2,'.','').')'}}</td>
        			<td>{{($arreglo[$venta->id]['itbms']=$venta->itbms).'% ('}}{{number_format((($venta->itbms/100)*$venta->total_bruto),2,'.','').')'}}</td>
        			<td>{{$arreglo[$venta->id]['total']=$venta->total}}</td>    	
                </tr>
            </table> 
        </div>
    </div>
@endforeach 
    
{{$ventas->links()}}

    
@stop

@section('modal')
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      

    </div>
  </div>
</div>
@stop
